package com.hdoit.ares.logical.cust.dao;

import java.util.Date;
import java.util.List;

import com.hdoit.ares.logical.cust.model.Customer;
import com.hdoit.ares.logical.viewmodel.cust.CustomerColumn;
import com.hdoit.ares.logical.viewmodel.cust.CustomerSearch;
import com.hdoit.ares.logical.viewmodel.cust.CustomerStatistic;
import com.hdoit.ares.logical.viewmodel.cust.CustomerTree;
import com.hdoit.ares.logical.viewmodel.cust.TeamShareCustomer;
import com.tennetcn.common.dao.base.ISuperDao;
import com.tennetcn.common.message.PagerModel;
/**
 * @author      chenghuan
 * @email       
 * @createtime  2017年10月26日 16:12:29
 * @comment
 */
public interface ICustomerDao extends ISuperDao<Customer>{
	public Customer queryModelByUserIdentity(int userIdentity);
	
	public String queryIdByUserIdentity(int userIdentity);
	
	public int queryMaxUserIdentity();
	
	public Customer queryModelByOpenId(String openId);
	
	public int queryInviteSum(String id);
	
	public boolean updateRegister(Customer customer);

	public List<TeamShareCustomer> queryOneTeamShare(String id);

	public int queryOneTeamShareCount(String id);
	
	public List<TeamShareCustomer> queryTwoTeamShare(String id);
	
	public int queryTwoTeamShareCount(String id);
	
	public List<Customer> queryCurrentChildCustomer(String id);
	
	public List<TeamShareCustomer>queryWechatSearch(String searchContent,String id);
	
	//用于后台的查询方法
    public List<Customer> queryListMP(CustomerSearch customerSearch,PagerModel pagerModel);
	
	public List<Customer> queryListMP(CustomerSearch customerSearch);
	
	public int queryCountMP(CustomerSearch customerSearch);
	
	public Customer queryModelMP(String key);

	public List<Customer> queryListById(CustomerSearch customerSearch,PagerModel pagerModel,String key);
	    
	public int queryCountById(CustomerSearch customerSearch,String key);

	public boolean updateLevel(String openId,String level);
	
	//public boolean updateLevelDetailed(String id,String level,String phone,String username,String region);
	
	public Customer queryRefereeModelByOpenId(String openId);

	public Customer queryModelByPhone(String phone);
	
	public boolean updateCustomerByJoinMaker(Customer customer);
	
	public boolean updateCustDetail(String column,String id,Object value);
	
	public List<Customer> queryListByBuyer(String loginId);
		
	public boolean updateCustomerState(String loginId,String autonym,String username,String idType,String idCode);
	
	//改变实名认证的状态
	public Boolean updateCustomerStateById(String id, String state);
	
	public List<Customer> queryListForAward(Date startDate,Date endDate);
	
	//查询城市下的每一天的关注数增加情况
    public int queryCustCount(String year,String month,String day,String nativeCity);
    
    //查询城市下从开始到这一天的关注总数
    public int queryAllCustCount(String date,String nativeCity);
    
    //修改密码
    public Boolean updatePassword(String newPassword,String customerId,String unionMark);
    
    //查找最顶层的customerTrees
    public List<CustomerTree> queryTopList(CustomerSearch search);
    
    //查找所有的CustomerTrees
    public List<CustomerTree> queryTreeList();
    
    //查找某一个人的所有消费情况
    public CustomerTree queryModelForConsumption(CustomerSearch search);
    
    //查找某一个人下级的的所有消费情况
    public List<CustomerTree> queryListForConsumption(CustomerSearch search);
    
    //查某一个月某一个状态的人数
    public List<Customer>  queryCountForStatistic(String state,CustomerSearch search);
    
    //统计各种级别的人数
    public CustomerStatistic queryModel(CustomerSearch search);

    //登陆
    public Customer login(String userId,String password);
    
    //判断unionId是否存在
    public Boolean queryUnionId(String unionId);

    //根据unionId查找customer
    public Customer queryModelByUnionId(String unionId);
    
    //根据unionId或者phone查找customer

    public Customer queryModelByUnionIdOrPhone(String unionId,String phone);


    //通过用户编号修改用户指定属性
    public boolean updateCustomerColumn(CustomerColumn customerColumn);
    

    //查询每日招募创客数
    public int queryCountDayMakers(String refereeId);
    
    //查询每周招募创客数
    public int queryCountWeekMakers(String refereeId);
    
    //查询每月招募创客数
    public int queryCountMonthMakers(String refereeId);
    
    //查询用户的下一级所有游客
    public List<Customer> queryNextVisitors(String refereeId);
}
